public class Practice2 {
    public int findPeakElement (int[] nums) {
        //二分查找
        int left = 0;
        int right = nums.length - 1;
        while(left < right){
            int mid = (left + right) / 2;
            //两边都是无穷小, 找出右边界就是上升的不断贴近即可
            if(nums[mid] < nums[mid + 1]){
                left = mid + 1;
            }else{
                right = mid;
            }
        }
        //注意返回下标
        return left;
    }
    public static void main(String[] args) {

    }
}
